// --------------------------------------------------------------------------------------------------------------------- 
// <copyright file="DependencyResolver.cs" company="Scrum for Team System">
//   None
// </copyright>
// <summary>
//   Defines the DependencyResolver type.
// </summary>
// ---------------------------------------------------------------------------------------------------------------------
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "ScrumForTeamSystem.EventService.Services", Justification = "namespace includes many internal classes")]
namespace ScrumForTeamSystem.EventService.Services
{
    using ScrumForTeamSystem.EventService.Infrastructure.Interfaces;

    /// <summary>
    /// Defines the DependencyResolver type.
    /// </summary>
    public static class DependencyResolver
    {
        /// <summary>
        /// The dependency resolver instance
        /// </summary>
        private static IDependencyResolver instance;

        /// <summary>
        /// Gets or sets the instance.
        /// </summary>
        /// <value>The instance.</value>
        public static IDependencyResolver Instance
        {
            get { return instance = instance ?? new CustomDependencyResolver(); }
            set { instance = value; }
        }

        /// <summary>
        /// Gets the implementation of the specified type.
        /// </summary>
        /// <typeparam name="T">The type to retrieve</typeparam>
        /// <returns>An instance of the specified type</returns>
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter", Justification = "Not relevant for this pattern")]
        public static T GetImplementation<T>()
        {
            return Instance.GetImplementationOf<T>();
        }
    }
}
